<%@ page import="cn.gudian.cms.Admin.AdminUser" %>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  <meta name="layout" content="main"/>
  <title><g:message code="adminUser.create" default="Create AdminUser"/></title>
</head>
<body>
<div class="nav">
  <span class="menuButton"><a class="home" href="${createLinkTo(dir: '')}"><g:message code="home" default="Home"/></a></span>
  <span class="menuButton"><g:link class="list" action="list"><g:message code="adminUser.list" default="AdminUser List"/></g:link></span>
</div>
<div class="body">
  <h1><g:message code="adminUser.create" default="Create AdminUser"/></h1>
  <g:if test="${flash.message}">
    <div class="message"><g:message code="${flash.message}" args="${flash.args}" default="${flash.defaultMessage}"/></div>
  </g:if>
  <g:hasErrors bean="${adminUserInstance}">
    <div class="errors">
      <g:renderErrors bean="${adminUserInstance}" as="list"/>
    </div>
  </g:hasErrors>
  <g:form action="save" method="post">
    <div class="dialog">
      <table>
        <tbody>
         <gd:isPermit roles="SYSTEM_ADMIN">
          <tr class="prop">
            <td valign="top" class="name">
              <label for="adminRole"><g:message code="adminUser.adminRole" default="Admin Role"/>:</label>
            </td>
            <td valign="top" class="value ${hasErrors(bean: adminUserInstance, field: 'adminRole', 'errors')}">
              <g:select name="adminRole.id" from="${cn.gudian.cms.Admin.AdminRole.list()}" optionKey="id" value="${adminUserInstance?.adminRole?.id}"/>
            </td>
          </tr>
        </gd:isPermit>
        <tr class="prop">
          <td valign="top" class="name">
            <label for="userName"><g:message code="adminUser.userName" default="User Name"/>:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: adminUserInstance, field: 'userName', 'errors')}">
            <g:textField name="userName" maxlength="15" value="${fieldValue(bean: adminUserInstance, field: 'userName')}"/>

          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="password"><g:message code="adminUser.password" default="Password"/>:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: adminUserInstance, field: 'password', 'errors')}">
            <g:textField name="password" value="${fieldValue(bean: adminUserInstance, field: 'password')}"/>

          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="realName"><g:message code="adminUser.realName" default="Real Name"/>:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: adminUserInstance, field: 'realName', 'errors')}">
            <g:textField name="realName" value="${fieldValue(bean: adminUserInstance, field: 'realName')}"/>

          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="mobile"><g:message code="adminUser.mobile" default="Mobile"/>:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: adminUserInstance, field: 'mobile', 'errors')}">
            <g:textField name="mobile" value="${fieldValue(bean: adminUserInstance, field: 'mobile')}"/>

          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="email"><g:message code="adminUser.email" default="Email"/>:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: adminUserInstance, field: 'email', 'errors')}">
            <g:textField name="email" value="${fieldValue(bean: adminUserInstance, field: 'email')}"/>

          </td>
        </tr>

        <tr class="prop">
          <td valign="top" class="name">
            <label for="arcTypeIDs">可管理的栏目:</label>
          </td>
          <td valign="top" class="value ${hasErrors(bean: adminUserInstance, field: 'arcTypeIDs', 'errors')}">
          
             <gd:arcTypeMultipleSelect nbsp="1" size="11" id="arcTypeIDs"></gd:arcTypeMultipleSelect>
          </td>
        </tr>
      
        </tbody>
      </table>
    </div>
    <div class="buttons">
      <span class="button"><g:submitButton name="create" class="save" value="${message(code: 'create', 'default': 'Create')}"/></span>
    </div>
  </g:form>
  
</div>
</body>
</html>
